package com.tobeface.sns.application.blog.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.kissme.core.orm.Page;
import com.tobeface.sns.application.blog.BlogService;
import com.tobeface.sns.domain.blog.Blog;
import com.tobeface.sns.infrastructure.persist.blog.BlogRepository;

/**
 * @author Linxiaosheng
 */
@Service
public class BlogServiceImpl implements BlogService {

	@Autowired
	private BlogRepository blogRepository;

	/*
	 * (non-Javadoc)
	 * @see com.sinzv.sns.application.blog.BlogService#save(com.sinzv.sns.domain.blog.Blog)
	 */
	@Override
	public Blog save(Blog blog) {
		return blogRepository.save(blog); 
	}

	/*
	 * (non-Javadoc)
	 * @see com.sinzv.sns.application.blog.BlogService#findOne(java.lang.String)
	 */
	@Override
	public Blog findOne(String id) {
		return blogRepository.findOne(id);
	}

	/*
	 * (non-Javadoc)
	 * @see com.sinzv.sns.application.blog.BlogService#findPage(com.kissme.core.orm.Page)
	 */
	@Override
	public Page<Blog> findPage(Page<Blog> page) {
		return blogRepository.findPage(page); 
	}
	
}
